
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Defining an executable application project</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp274.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp276.htm" >Next</A>
<!-- End Header -->
<A NAME="CHDCGGEE"></A><h1>Defining an executable application project</h1>
<A NAME="TI10136"></A><p>The Project painter for executable applications allows you
to streamline the generation of executable files and dynamic libraries.
When you build a project object, you specify the following components
of your application:<A NAME="TI10137"></A>
<ul>
<li class=fi>Executable
file name</li>
<li class=ds>Which of the libraries you want to distribute as
dynamic libraries</li>
<li class=ds>Which PowerBuilder resource files (if any) should
be used to build the executable file and the dynamic libraries</li>
<li class=ds>Which build options you want to use in your project</li>
<li class=ds>Which code generation options you want to use</li>
<li class=ds>Version information for your application
</li>
</ul>
</p>
<A NAME="TI10138"></A><p>If you do not use the Template Application Target wizard to
create a new application project, you need to define the project
using a Project wizard or by setting project properties in the Project
painter. After you have created a project, you might need to update
it later because your library list has changed or you want to change
your compilation options.</p>
<A NAME="TI10139"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To define or modify an executable application
project:</p>
<ol><li class=fi><p>Select the Application project icon on
the Project tab in the New dialog box to create a new application
project, or select File&gt;Open to open an existing application
project.</p><p>The Project painter workspace displays.</p><br><img src="images/exe02.gif"><br>
</li>
<li class=ds><p>Specify or modify options as needed.</p><p>If you opened an existing project or a project
created using the wizard, the options already selected display in
the workspace. For information about each option, see <A HREF="pbugp275.htm#CHDDBBDJ">"Executable application project
options"</A>.</p></li>
<li class=ds><p>When you have finished defining the project object,
save the object by selecting File&gt;Save from the menu bar.</p><p>PowerBuilder saves the project as an independent object in
the specified library. Like other objects, projects are displayed
in the System Tree and the Library painter.</p></li></ol>
<br><A NAME="CHDDBBDJ"></A><h4>Executable application project
options</h4>
<A NAME="TI10140"></A><p><A HREF="pbugp275.htm#CACIGFDE">Table 34-2</A> describes
each of the options you can specify in the Project painter for executable
applications. You can also specify most of these options in the Application
Project wizard.</p>
<A NAME="CACIGFDE"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 34-2: Options for executable application
projects</caption>
<tr><th  rowspan="1"  ><A NAME="TI10141"></A>Option</th>
<th  rowspan="1"  ><A NAME="TI10142"></A>What you specify</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10143"></A>Executable file name</td>
<td  rowspan="1"  ><A NAME="TI10144"></A>Specify a name for the executable. The
name must have the extension <i>EXE</i>. If you do not
want the executable saved to your current directory, click the Browse
(...) button next to the box to navigate to a different directory.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10145"></A>Resource file name</td>
<td  rowspan="1"  ><A NAME="TI10146"></A>(Optional) Specify a PowerBuilder resource
file (PBR) for your executable if you dynamically reference resources
(such as bitmaps and icons) in your scripts <i>and</i> you want
the resources included in the executable file instead of having
to distribute the resources separately.<A NAME="TI10147"></A><p>You can type the name of a resource file in the box or click
the button next to the box to browse your directories for the resource
file you want to include.</p><A NAME="TI10148"></A><p>For more about PBRs, see <A HREF="pbugp278.htm#X-REF302356230">"Distributing resources "</A>.</p></td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10149"></A>Prompt for overwrite</td>
<td  rowspan="1"  ><A NAME="TI10150"></A>Select this if you want PowerBuilder
to prompt you before overwriting files. PowerBuilder overwrites
any files it creates when building your application. </td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10151"></A>Windows classic style</td>
<td  rowspan="1"  ><A NAME="TI10152"></A>Select this to add a manifest file to
the application that specifies the appearance of the controls as
an application resource. When a user runs the application on Windows
XP with the Windows XP style for controls set in the control panel,
all PowerBuilder windows, DataWindow controls that mirror standard
Windows controls, and other controls, display with the new style.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10153"></A>Rebuild</td>
<td  rowspan="1"  ><A NAME="TI10154"></A>Specify either Full or Incremental to
indicate whether you want PowerBuilder to regenerate all objects
in the application libraries before it creates the executable and dynamic
libraries. If you choose Incremental, PowerBuilder regenerates only
objects that have changed, and objects that reference any objects
that have changed, since the last time you built your application.<A NAME="TI10155"></A><p>As a precaution, regenerate all objects before rebuilding
your project. </p></td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10156"></A>Machine Code</td>
<td  rowspan="1"  ><A NAME="TI10157"></A>Select this if you want to generate compiled
code instead of Pcode. For more information about compiled code
and Pcode, see <i>Application Techniques.</i>
<A NAME="TI10158"></A><p>Selecting Machine Code enables the other code generation options
in the Project painter. They cannot be set in the wizard.</p></td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10159"></A>Trace Information</td>
<td  rowspan="1"  ><A NAME="TI10160"></A>Select this if you want to create a trace
file when you run your compiled code executable. You can use the
trace file to troubleshoot or profile your application. For more
information on obtaining trace information, see <A HREF="pbugp279.htm#X-REF352470517">"Tracing execution"</A>.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10161"></A>Error Context Information</td>
<td  rowspan="1"  ><A NAME="TI10162"></A>Select this if you want PowerBuilder
to display context information (such as object, event, and script
line number) for runtime errors.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10163"></A>Optimization</td>
<td  rowspan="1"  ><A NAME="TI10164"></A>Select an optimization level. You can
build your application with no optimizations, or you can optimize
for speed or space.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10165"></A>Enable DEBUG symbol</td>
<td  rowspan="1"  ><A NAME="TI10166"></A>Select to enable any code that you placed
in DEBUG conditional code blocks. For more information, see <A HREF="pbugp264.htm#CHDJDBAH">"Using the DEBUG preprocessor
symbol"</A>.</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10167"></A>Libraries page</td>
<td  rowspan="1"  ><A NAME="TI10168"></A>The label for the PBD or DLL check box
depends on whether you are building a Pcode or machine code executable.
Select the check box to define a library as a dynamic library to
be distributed with your application.<A NAME="TI10169"></A><p>If you are generating Pcode, you create PBD files. If you
are generating machine code, you create DLL files. For more about
dynamic libraries, see <A HREF="pbugp276.htm#X-REF364216420">"Using dynamic libraries "</A>.</p><A NAME="TI10170"></A><p>Specify a resource file for a dynamic library if it uses resources
(such as bitmaps and icons) and you want the resources included
in the dynamic library instead of having to distribute the resources
separately. The file name cannot be specified in the wizard.</p></td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10171"></A>Version page</td>
<td  rowspan="1"  ><A NAME="TI10172"></A>Specify your own values for the Product
Name, Company Name, Description, Copyright, Product Version, and
File Version fields associated with the executable file and with
machine-code DLLs. These values become part of the Version resource associated
with the executable file, and most of them display on the Version
tab page of the Properties dialog box for the file in Windows Explorer.
The Product and File version string fields can have any format.<A NAME="TI10173"></A><p>The Product and File version numeric fields in the "Executable
version used by installer" group box are used by Microsoft
Installer to determine whether a file needs to be updated when a
product is installed. </p><A NAME="TI10174"></A><p>The four numbers can be used to represent the major version,
minor version, point release, and build number of your product.
They must all be present. If your file versioning system does not
use all these components, you can replace the unused numbers with
zeroes. The maximum value for any of the numbers is 65535.</p></td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10175"></A>Security page</td>
<td  rowspan="1"  ><A NAME="TI10176"></A>Use the Security tab page to generate
a manifest file (either external or embedded) and to set the execution
level of the application.To meet the certification requirements of
the Windows Vista Logo program the application executable must have
an embedded manifest that defines the execution level and specifies
whether access to the user interface of another window is required. <A NAME="TI10177"></A><p>For further information, see <A HREF="pbugp277.htm#CHDFHGCCCS">"Attaching or embedding
manifest files"</A>.</p></td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI10178"></A>Run page</td>
<td  rowspan="1"  ><A NAME="TI10179"></A>Specify command-line arguments and the
application's working directory. The Application field
displays the name and location of the executable file and is not editable.
You can change these properties on the General page.</td>
</tr>
</table>
<A NAME="TI10180"></A><h4>Location of temporary files</h4>
<A NAME="TI10181"></A><p>The machine code generation process puts temporary files in
a temporary directory, such as the <i>TEMP</i> directory.
You can specify a different location in the [PB] section
of your PowerBuilder initialization file with the CODEGENTEMP variable.
You might want to do this if you have limited space on your local
system.</p>
<A NAME="TI10182"></A><p>For example:<p><PRE> CODEGENTEMP=e:\pbtempdir</PRE></p>

